import axios from "@/utils/http";
export enum API {
  login = "/api/login",
  getUserInfo = "/api/user/getUserInfo",
  ceatUser = "/api/ceatUser",
  getUserList = "/api/user/getUserList",
  upDataUser = "/api/user/upDataUser",
  DellUser = "/api/user/dellUser",
}

export const login = <T>(parmas: any): Promise<T> => {
  return axios.post(API.login, parmas) as Promise<T>;
};
export const getUserInfo = <T>(): Promise<T> => {
  return axios.get(API.getUserInfo) as Promise<T>;
};

export const ceatUser = <T>(parmas: any): Promise<T> => {
  return axios.post(API.ceatUser,parmas) as Promise<T>;
};
export const UpDataUser = <T>(parmas: any): Promise<T> => {
  return axios.post(API.upDataUser,parmas) as Promise<T>;
};
export const DellUser = <T>(parmas: any): Promise<T> => {
  return axios.post(API.DellUser,parmas) as Promise<T>;
};

export const getUserList = <T>(parmas: any): Promise<T> => {
  return axios.get(API.getUserList,parmas) as Promise<T>;
};